/*

火车买票案例 (两种实现方式) : 共100张票,三个线程一起卖票,不允许出现出现负票和多卖的现象
        (描述设置锁的时候要注意的事项:(Thread 和Runnable)

        */
public class TicketThreadDemo {
    public static void main(String[] args) {
        TicketThread tr = new TicketThread();

        Thread t = new Thread(tr);
        t.setName("窗口一");

        Thread t2 = new Thread(tr);
        t2.setName("窗口二");

        Thread t3 = new Thread(tr);
        t3.setName("窗口三");

        t.start();
        t2.start();
        t3.start();
    }
}
